#ifndef INCLUDE_PATHPLANNER_H
#define INCLUDE_PATHPLANNER_H

#include <vector>
#include <list>
#include <boost/shared_ptr.hpp>
#include "GlobalStructure.h"
#include "FrictionModel.h"
#include "PerfectFriction.h"
#include "Visualizer.h"

namespace ompl
{
    namespace geometric
    {
        class PathGeometric;
        class SimpleSetup;
    }
}

namespace PlayerCc
{
    class MapProxy;
}

class PathPlanner
{
public:
    ~PathPlanner();

    static PathPlanner& Instance();

    bool IsPosValid( const double dX, const double dY );
    void Init( const PlayerCc::MapProxy &map,  const boost::shared_ptr<FrictionModel> frictionModel = boost::shared_ptr<FrictionModel>(new PerfectFriction()), const bool bUsePRRT = false );
    bool Plan( std::vector<Position>& outSolved, const double dStartX, const double dStartY, const double dEndX, const double dEndY, const double dStepRange );
    bool Plan( std::list<Position>& outSolution, const double dStartX, const double dStartY, const double dEndX, const double dEndY, const double dStepRange );
    void setVisualizer(boost::shared_ptr<Visualizer> visualizer);

private:
    PathPlanner();
    ompl::geometric::SimpleSetup* ss;
    bool m_bUsePRRT;
};

#endif
